package core.gamemodes;

import core.Player;
import core.PlayerData;
import core.SingleButtonGame;
import core.actions.AddMachinegun;
import core.actions.FireLaser;
import core.actions.FireMissile;
import core.actions.FireMortar;
import core.actions.FireShotgun;
import core.actions.FireSniper;
import core.actions.MoveHero;
import core.actions.NextUnit;
import core.mountedWeapons.GenericPistol;
import core.units.HeroUnit;
import core.units.Unit;

public class FreeForAll extends GameMode{

	public FreeForAll(SingleButtonGame m){
		super(m);
		name = "Free for All";
	}
	
	public void setupPlayerData(PlayerData d){
		
		setupUnits(d);
	}
	
	private void setupUnits(PlayerData d){
		Unit u = new HeroUnit(0, 0, null);
		u.setSpriteName("testTankV1.png");
		u.addWeapon(new GenericPistol(20, 70));
		u.actionMap.clear();
		u.actionMap.setWantedDepth(2);
					
		u.actionMap.add(new MoveHero());
		u.actionMap.add(new NextUnit());
		
		u.actionMap.add(new FireMortar());
		u.actionMap.add(new FireLaser());
		
		u.actionMap.add(new FireShotgun());		
		u.actionMap.add(new FireSniper());
		
		u.actionMap.add(new FireMissile());
		u.actionMap.add(new AddMachinegun());
		
		u.actionMap.set(new AddMachinegun(), 0, 2);
		
		
		
		d.addUnit(u);
		d.selectNextUnit();
		
		
		u = new HeroUnit(0, 0, null);
		u.setImageName("iconLightTank1.png");
		u.setSpriteName("testTankV1.png");
		u.setSpeed(600);		
		u.addWeapon(new GenericPistol(30, 150));
		u.actionMap.clear();
		u.actionMap.setWantedDepth(2);
		
		u.actionMap.add(new MoveHero());
		u.actionMap.add(new NextUnit());
		
		u.actionMap.add(new FireShotgun());	
		u.actionMap.add(new FireSniper());
		
		u.actionMap.set(new FireMissile(), 0, 2);
		
		
		d.addUnit(u);
		
		
	}


	protected void additionalPlayerSetup(Player p){
		p.spawnAdditionalUnit();
	}
}
